{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": [
    "import pygame as p\n",
    "from pygame.locals import *\n",
    "import time\n",
    "import sys\n",
    "\n",
    "img='fujun.jpg'\n",
    "p.init()\n",
    "screen=p.display.set_mode((600,480),0,32)\n",
    "p.display.set_caption('fujun')\n",
    "backgroud=p.image.load(img).convert()\n",
    "\n",
    "while True:\n",
    "    for event in p.event.get():\n",
    "        if event.type==QUIT:\n",
    "            sys.exit()\n",
    "    screen.blit(backgroud,(0,0))\n",
    "    x,y=p.mouse.get_pos()\n",
    "    print(x,y)\n",
    "#     x-=mouse_cursor.get_width()/2\n",
    "#     y-=mouse_cursor.get_height()/2\n",
    "#     screen.bilt(mouse_cursor,(x,y))\n",
    "    \n",
    "    p.display.update()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
